package org.dx.oho.dto;

import org.dx.oho.entity.Shop;
import org.dx.oho.enums.ShopStateEnum;
import org.jetbrains.annotations.NotNull;

import java.util.List;

/**
 * 操作店铺后的返回属性，返回值
 * create by duanx 2021/1/31
 *@classname: ShopExecution
 *@author: duanx
 *@date: 2021/1/31 19:42
 **/
public class ShopExecution {
    /**
     * 结果状态
     */
    private int state;
    /**
     * 状态标识
     */
    private String stateInfo;
    /**
     * 店铺数量
     */
    private int count;
    /**
     * 操作的店铺
     */
    private Shop shop;
    /**
     * 查询的列表
     */
    private List<Shop> shopList;

    /**
     * 空构造器
     */
    public ShopExecution() {
    }

    /**
     * 店铺操作失败的的构造器
     * @param shopStateEnum 状态
     */
    public ShopExecution(@NotNull ShopStateEnum shopStateEnum){
        this.state = shopStateEnum.getState();
        this.stateInfo = shopStateEnum.getStateInfo();
    }

    /**
     * 店铺操作成功时的构造器
     * @param shopStateEnum  状态
     * @param shop 店铺信息
     */
    public ShopExecution(@NotNull ShopStateEnum shopStateEnum,Shop shop){
        this.state = shopStateEnum.getState();
        this.stateInfo = shopStateEnum.getStateInfo();
        this.shop = shop;
    }

    /**
     * 批量操作店铺成功时的构造器
     * @param shopStateEnum 状态
     * @param shopList 列表
     */
    public ShopExecution(@NotNull ShopStateEnum shopStateEnum, List<Shop> shopList){
        this.state = shopStateEnum.getState();
        this.stateInfo = shopStateEnum.getStateInfo();
        this.shopList = shopList;
    }

    public int getState() {
        return state;
    }

    public void setState(int state) {
        this.state = state;
    }

    public String getStateInfo() {
        return stateInfo;
    }

    public void setStateInfo(String stateInfo) {
        this.stateInfo = stateInfo;
    }

    public int getCount() {
        return count;
    }

    public void setCount(int count) {
        this.count = count;
    }

    public Shop getShop() {
        return shop;
    }

    public void setShop(Shop shop) {
        this.shop = shop;
    }

    public List<Shop> getShopList() {
        return shopList;
    }

    public void setShopList(List<Shop> shopList) {
        this.shopList = shopList;
    }
}
